home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / GX Libraries / CameraLibrary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-07  |  1.5 KB  |  72 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.     File:        CameraLibrary.h
  4.  
  5.     Contains:    graphics libraries - perspective mapping generation routines
  6.  
  7.     Written by:    Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  8.  
  9.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  10.  
  11.     Change History (most recent first):
  12.  
  13.          <3>      4/7/95    jtd        changed 'fract' to 'Fract'
  14.          <2>     1/24/95    JD        updated to latest GX 1.1 source (as of 16 Jan 1995)
  15.          <1>      1/9/95    JD        First checked in.
  16. */
  17.  
  18. #ifndef __CAMERALIBRARY__
  19. #define __CAMERALIBRARY__
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. /* for compatibility with old headers */
  26. #define cameraLibraryIncludes
  27.  
  28. #include <GXMath.h>
  29.  
  30. struct point3D {
  31.     Fixed    x;
  32.     Fixed    y;
  33.     Fixed    z;
  34. };
  35. typedef struct point3D point3D;
  36.  
  37. struct unit3D {
  38.     Fract        x;
  39.     Fract        y;
  40.     Fract        z;
  41. };
  42. typedef struct unit3D unit3D;
  43.  
  44. struct camera {
  45.     struct point3D        location;
  46.     struct point3D        axis;
  47.     struct point3D        zenith;
  48.     struct point3D        observer;
  49.     gxMapping            orientation;
  50. };
  51. typedef struct camera camera;
  52.  
  53. struct patch {
  54.     struct point3D        u;
  55.     struct point3D        v;
  56.     struct point3D        origin;
  57. };
  58. typedef struct patch patch;
  59.  
  60. camera* InitCamera(camera *);
  61. camera* UpdateCamera(camera *);
  62. gxMapping* PatchToCameraMap(const patch *, const camera *, gxMapping *);
  63. Fixed Unitize(const point3D *, unit3D *);
  64. Fract FracDot(const unit3D *, const unit3D *);
  65. unit3D* FracCross(const unit3D *, const unit3D *, unit3D *cross);
  66.  
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70.  
  71. #endif /* __CAMERALIBRARY__ */
  72.